11 Lecture
CS504
Midterm & Final Term Short Notes
Software Design
Software design is the meticulous process of conceptualizing, planning, and organizing the architecture, structure, and functionality of a software system. It involves thoughtful consideration of user requirements, efficient algorithms, scalable
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
Which of the following is NOT a software design principle? a) Encapsulation b) Abstraction c) Polymorphism d) Inheritance Solution: c) Polymorphism Which design pattern is used to decouple objects and promote loose coupling? a) Observer b) Singleton c) Factory d) Prototype Solution: a) Observer Which software design principle states that software entities should have only one reason to change? a) Single Responsibility Principle (SRP) b) Open-Closed Principle (OCP) c) Liskov Substitution Principle (LSP) d) Interface Segregation Principle (ISP) Solution: a) Single Responsibility Principle (SRP) Which design pattern is used to create objects without specifying their exact class? a) Adapter b) Prototype c) Builder d) Abstract Factory Solution: b) Prototype Which design principle promotes the idea of coding to an interface rather than an implementation? a) Dependency Inversion Principle (DIP) b) Interface Segregation Principle (ISP) c) Liskov Substitution Principle (LSP) d) Open-Closed Principle (OCP) Solution: b) Interface Segregation Principle (ISP) Which design pattern is used to provide a simple interface to a complex subsystem? a) Facade b) Decorator c) Proxy d) Composite Solution: a) Facade Which design principle suggests that classes should be open for extension but closed for modification? a) Interface Segregation Principle (ISP) b) Liskov Substitution Principle (LSP) c) Single Responsibility Principle (SRP) d) Open-Closed Principle (OCP) Solution: d) Open-Closed Principle (OCP) Which design pattern is used to encapsulate the creation of an object into a single function call? a) Singleton b) Abstract Factory c) Builder d) Factory Method Solution: d) Factory Method Which software design principle suggests that high-level modules should not depend on low-level modules but both should depend on abstractions? a) Dependency Inversion Principle (DIP) b) Liskov Substitution Principle (LSP) c) Interface Segregation Principle (ISP) d) Single Responsibility Principle (SRP) Solution: a) Dependency Inversion Principle (DIP) Which design pattern is used to encapsulate a request as an object, thereby allowing users to parameterize clients with queues, requests, and operations? a) Iterator b) Command c) Strategy d) Memento Solution: b) Command
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
What is the difference between cohesion and coupling in software design? Answer: Cohesion refers to the degree of relatedness within a module, indicating how closely the responsibilities of the module are aligned. Coupling, on the other hand, measures the degree of interdependence between modules. High cohesion and low coupling are desirable design qualities. Explain the SOLID principles of software design. Answer: SOLID is an acronym representing five design principles: Single Responsibility Principle (SRP), Open-Closed Principle (OCP), Liskov Substitution Principle (LSP), Interface Segregation Principle (ISP), and Dependency Inversion Principle (DIP). These principles guide software design to achieve modularity, maintainability, and extensibility. What is the purpose of design patterns in software development? Answer: Design patterns provide proven solutions to recurring design problems in software development. They promote reusable and modular designs, improve code maintainability, and facilitate communication among developers by providing a common vocabulary for discussing design concepts. What is the difference between the factory method and abstract factory design patterns? Answer: The factory method pattern defines an interface for creating objects, but allows subclasses to decide which class to instantiate. In contrast, the abstract factory pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes. What are the advantages of using the Model-View-Controller (MVC) architectural pattern? Answer: MVC promotes separation of concerns by dividing an application into three components: the model (data and business logic), the view (user interface), and the controller (handles user input and coordinates model-view interaction). Benefits include modularity, code reusability, and ease of maintenance. Explain the concept of loose coupling in software design. Answer: Loose coupling refers to reducing dependencies between software components. It allows changes in one component to have minimal impact on others, making the system more flexible and maintainable. Loose coupling is achieved through well-defined interfaces and dependency injection. What is the purpose of the decorator design pattern? Answer: The decorator pattern allows behavior to be added dynamically to an object at runtime by wrapping it in a decorator class. This pattern provides a flexible alternative to subclassing for extending the functionality of individual objects without modifying their original classes. Describe the concept of inversion of control (IoC) in software design. Answer: Inversion of Control refers to the shift of control from application code to a framework or container. Instead of instantiating and managing dependencies directly, IoC containers handle the creation and injection of dependencies, promoting loose coupling and modular design. What is the role of the architect in software design? Answer: The architect is responsible for designing the overall structure and behavior of a software system. They make high-level design decisions, define architectural patterns, choose appropriate technologies, and ensure that the system meets functional and non-functional requirements. What are the key considerations when designing for scalability in software systems? Answer: When designing for scalability, considerations include distributed architecture, horizontal scaling, efficient resource utilization, load balancing, caching strategies, and the ability to handle increasing volumes of data and users while maintaining performance and reliability.